<!-- 取消订单 -->
<div class="float-confirm js_cancelOrderDiv" style="z-index: 20000;display: none; width:auto;">
    <div class="float-confirm-con">
        <p style="font-size:18px;color:#23a18b;">取消订单理由</p>
        <div style="width:auto;height:1px;background:#CCC;margin-bottom:20px;"></div>
        <div style="width:500px;height:auto;margin-bottom:15px;">
            <table style="line-height:50px;" class="js_expressTable">
                <tr>
                    <td>理由：</td>
                    <td style="min-width:400px;">
                        <textarea name="reason" class="add-f-area textarea_box js_cancelOrderReason"></textarea>
                    </td>
                </tr>
            </table>
        </div>
        <div style="width:auto;height:1px;background:#CCC;margin-bottom:20px;"></div>
        <div class="float-confirm-btns" style="padding-bottom:30px;">
            <a id="js_cancelOrderAllow" class="btn btn-success btn-sm left" href="javascript:void(0);">确定</a>
            <a class="btn btn-default btn-sm left js_cancel" href="javascript:void(0);">取消</a>
        </div>
    </div>
</div>
<script>
    (function ($) {
        //取消订单事件
        $('.js_cancelOrderBtn').click(function () {
            var order_id = $(this).closest('tr').data('id');
            showConfirmDiv($('.js_cancelOrderDiv'), order_id);
        });

        //同意取消订单操作
        $('#js_cancelOrderAllow').click(function () {
            var order_reason = $.trim($('.js_cancelOrderReason').val());
            var id = $('.js_cancelOrderDiv').data('id');

            if (!order_reason || order_reason == '') {
                showMsg('请填写取消订单的理由');
                return false;
            }

            showMask('正在提交中...', 1);

            $.post(
                "{AnUrl('order/admin/cancel_order')}",
                {
                    order_reason: order_reason,
                    id: id
                },
                function (data) {
                    if (data.info != 'ok') {
                        showMsg(data.info);
                    }
                    location.href = location.href;
                },
                'json'
            );
        });
    })(jQuery);
</script>
<!-- /取消订单 -->